<?php
class Prestador extends Modelo_base {

	var $table = 'prestadores';

	var $has_one = array('veterinari', 'usuario');
    var $has_many = array("animal", "cobertura");

    // Validaciones de campos
    var $validation = array(
        'nombre' => array(
            'label' => 'Nombre',
            'rules' => array('required', 'trim', 'max_length' => 50, 'unique')
            ),
        'telefono' => array(
            'label' => 'Teléfono',
            'rules' => array('trim', 'max_length' => 30)
            ),
        'email' => array(
            'label' => 'Email',
            'rules' => array('trim', 'max_length' => 80, 'valid_email')
            ),
        'veterinari' => array(
            'label' => 'Veterinaria',
            'rules' => array('required')
            ),
        'usuario' => array(
            'label' => 'Usuario de sistema',
            'rules' => array('required')
            )
    );

    // Optionally, don't include a constructor if you don't need one.
    function __construct($id = NULL)
    {
        parent::__construct($id);
    }
}

/* End of file prestador.php */
/* Location: ./application/models/prestador.php */